package cn.getech.data.development.constant;

import lombok.Getter;

import java.util.Objects;

/**
 * @Author luoxi
 * @create 2020/11/16 15:40
 */
@Getter
public enum DataSyncTaskEnum {
    TASK_STATUS_NOT_START(0,"未开始"),
    TASK_STATUS_STARTING(1,"进行中"),
    TASK_STATUS_SUCCESS(2,"成功"),
    TASK_STATUS_FAIL(3,"失败"),
    TASK_STATUS_STOP(4,"中止");


    private Integer code;

    private String message;

    DataSyncTaskEnum(Integer code,String message){
        this.code=code;
        this.message=message;
    }

    public static String getMsg(Integer code){
        if(Objects.isNull(code)){
            return "";
        }
        for (DataSyncTaskEnum value : DataSyncTaskEnum.values()) {
            if(Objects.equals(value.getCode(),code)){
                return value.getMessage();
            }
        }
        return "";
    }

}
